﻿@model List<Article>
@{
    Layout = null;
    Sysconfig config = ViewData["config"] as Sysconfig;    
}
<!DOCTYPE html>
<!--HTML5 doctype-->
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
    <title>站内搜索</title>
    <link rel="stylesheet" type="text/css" href="/mobile/css/style.css" />
    <script type="text/javascript" charset="utf-8" src="/mobile/js/zepto.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="/mobile/js/weui.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="/mobile/js/common.js"></script>
    <script type="text/javascript">
        $(function () {
            $(".weui-tabbar a").eq(2).addClass("weui-bar__item_on"); //选中Tab
        });
    </script>
</head>

<body ontouchstart>
    <div class="page">
        <!--页面头部-->
        <div class="header">
            <a class="back" href="javascript:history.back();">
                <i class="iconfont icon-arrow-left"></i>
            </a>
            <div class="search-box">
                <div class="input-box">
                    <input id="keywords" name="keywords" placeholder="输入关健字" onkeydown="if(event.keyCode==13){SiteSearch('/Web/Search/Index', '#keywords');return false};" />
                    <a href="javascript:;" onclick="SiteSearch('/Web/Search/Index', '#keywords');">
                        <i class="iconfont icon-search"></i>
                    </a>
                </div>
            </div>
            <div class="right">
                <a class="weui-cell_access weui-cell_link" asp-area="Web" asp-controller="Index" asp-action="Index">
                    <i class="iconfont icon-home"></i>
                </a>
                </a>
            </div>
        </div>
        <!--/页面头部-->
        <!--页面内容-->
        <div class="page__bd">
            <!--内容列表-->
            <!--取得一个DataTable-->
            <!--取得分页页码列表-->
            <div class="weui-panel weui-panel_access" style="margin-top:10px;">
                <div class="weui-panel__hd">
                    查询关健字：@ViewBag.keyword，共 @ViewBag.totalcount 条记录
                </div>
                <div class="weui-panel__bd">
                    <div class="txt-list">
                        <ul>
                            @foreach(Article dr in Model)
                            {
                                string linkurl = "/Web/News/Show/" + dr.id;
                                if(dr.channel_id==2)
                                {
                                    linkurl="/Web/Goods/Show/" + dr.id;
                                }
                                if(!string.IsNullOrEmpty(dr.link_url))
                                {
                                    linkurl = dr.link_url;
                                }
                            <li>
                                <a href="@linkurl">
                                    @if(!string.IsNullOrEmpty(dr.img_url))
                                    {
                                    <img src="@dr.img_url" />
                                    }
                                    <h2>@dr.title</h2>
                                    <div class="note">
                                        <p>@dr.zhaiyao</p>
                                        <p>
                                            <i class="hot">
                                                @dr.click 次
                                            </i>
                                            <i class="date">时间：@dr.add_time.ToString("yyyy-MM-dd")</i>
                                        </p>
                                    </div>
                                </a>
                            </li>
                            }
                            @if(ViewBag.totalcount ==0)
                            {
                            <div class="nodata">暂无相关记录...</div>
                            }
                        </ul>
                    </div>
                </div>
            </div>
            <!--/内容列表-->
            <!--分页页码-->
            <div class="page-list">
                @Html.Raw(ViewBag.pagelist)
            </div>
            <!--/分页页码-->
            <!--版权信息-->
            @await Html.PartialAsync("~/Areas/Web/Views/Shared/_Copyright.cshtml")
            <!--/版权信息-->
            <!--底部导航-->
            @await Html.PartialAsync("~/Areas/Web/Views/Shared/_Footer.cshtml")
            <!--/底部导航-->

        </div>
        <!--/页面内容-->

    </div>
</body>
</html>
